package com.chixing.day05_oop;

public class AccountTest2 {
    public static void main(String[] args) {
        CreditAccount ca1 = new CreditAccount();


        //父类 引用子类对象
        // 子类类型/ 父类类型 = new 子类()
        Account ca2 = new CreditAccount();

        SavingAccount sa = new SavingAccount();
        sa.depoist(100); //运行子类depoist的方法

        //多态
        Account sa2 = new SavingAccount();// 父类引用子类对象
        sa2.depoist(100); //运行子类depoist的方法
    }


}
